Next let's take a look at how you can
use a resource hierarchy to simplify permissions. As you may already know Google Cloud
resources are organized hierarchically and because of this they have a parent child
relationship with other resources and that resource conveys
permission inheritance. A Google Cloud project is your
primary means to organize resources. Every resource needs to be in a project. A cloud resource can be for
example a Cloud Task queue, Cloud Run Service or
a compute engine virtual machine. If you are a cloud identity or
google workspace customer, you can organize projects into folders and
you can create one organizational note. Each resource has exactly one parent
except for the top note which has not. Every resource in the hierarchy
has an I AM policy and you can grant permissions
are not using policy bindings. Policy bindings bind an identity to a role
to grant permissions on that resource. If you think back to the example of
publishing a message to a pub sub topic, what role did you need? Pub/Sub publisher,
how useful would it be to add that role to a project instead of to a pub sub topic. It turns out very useful because if you
add a policy binding at a higher level resource, it inherits to a lower
level resource that looks like this. The lower level resources such as the pub
sub topic from our running example inherits policy bindings
from their parents. This is useful when you need to grant
permissions to publish messages on all topics in a project as
opposed to just a single topic or human role that needs to
create new resources. Here is another way to look at
policy binding inheritance. If I am evaluates access to a resource,
it evaluates policy bindings from the parent resources and
their parents as well. The effective IAM policy
includes those bindings and you can't take permissions away
if it's been granted to a parent. Here's one catch to using I A M the role
granularity is a moving target. What this means is there exists roles
that can only be granted to all resources in a project but
not on a specific resource. As of June 2021,
an example of this is the cloud SQL client that's a role that lets you connect to
SQL instances but only to all of them. IAM resource granularity is
always in active development. So the details in this example
might change in the future. Google Cloud resources are organized
hierarchically into a parent child relationship that conveys
permissions using inheritance. Resources inherit policies, groups of
missions from all of their ancestors, their parents which will then be
inherited further down the chain. Permissions granted at a higher level in
the hierarchy cannot be removed by changes to the lower levels. In other words,
once a parent grants access a child or a child of a child cannot remove it. Child resources however can add
permissions which will then be inherited further down the chain